﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;

public partial class protected_UsersTest : System.Web.UI.Page {

    #region Methods ///////////////////////////////////////////////////////////////////////////

    /// <summary>
    /// Raises the <see cref="E:System.Web.UI.Control.Load"/> event.
    /// </summary>
    /// <param name="e">The <see cref="T:System.EventArgs"/> object that contains the event data.</param>
    protected override void OnLoad(EventArgs e) {
        base.OnLoad(e);

        btnStart.Click += new EventHandler(HandleStartClick);
    }

    /// <summary>
    /// Handles the start click.
    /// </summary>
    /// <param name="sender">The sender.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    void HandleStartClick(object sender, EventArgs e) {
        
        bool flag = false;
        for (int i = 0; i < 1000; i++) {
            if (Membership.GetUser() != null)
                flag = (Roles.IsUserInRole(Membership.GetUser().UserName, "Administrators") ||
                        Roles.IsUserInRole(Membership.GetUser().UserName, "Moderators")) ||
                        flag;
        }

    }
    #endregion
}
